feat(core): system-reminder injector (date / cwd / todos / files / AGENTS.md)#21
Merged
Conversation
Closes the "System-reminder injector (7 types)" line item from the M8 polish
list in the morning report. Lands 5 of the 7 types; 2 (plan-mode-active and
no-test-yet) are stubs in the ReminderType union for future implementation.
· packages/core/src/reminders/index.ts (NEW, ~145 lines)
- buildSystemReminders() composes per-type builders into a single
<system-reminder>...</system-reminder> block.
- dateReminder, cwdReminder — always fire.
- agentsMdMissingReminder — fires only when no AGENTS.md/DEEPCODE.md/
CLAUDE.md is in cwd; nudges the user toward /init.
- todosPendingReminder — reads <sessionDir>/todos.json; lists any
in_progress + pending items (uses activeForm for in_progress).
- externalFileModifiedReminder — given a knownFiles Map<path, mtimeMs>,
flags drift > 1s plus deletions; truncates at 5 items with "more"
suffix.
- prependReminders() convenience wrapper for callers that just want
"userMessage + maybe a reminder block".
- Per-builder errors are caught and don't poison the batch.
· packages/core/src/agent.ts
- RunAgentOptions.systemReminders?: false | { enabled?: ReminderType[] }
- Before appending the user message, build the reminder block and prepend
it as text to the user content. Reminders default ON; pass `false` to
disable.
- 2 new agent tests cover the injected/skipped cases.
Tests: core 317 → 340 (+23: 21 reminder unit + 2 agent integration).
Total 364 → 387 passing.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
oratis
added a commit
that referenced
this pull request
May 28, 2026
This session ("继续推进" from v2) added 5 PRs on top of #1-#16:
· #17 M3c-rest tools (TodoWrite + WebFetch + WebSearch)
· #18 M3.5 attack tests + security-model.md
· #19 M8 headless mode (-p / --print)
· #20 M5.2 plugin live wire-up
· #21 system-reminder injector
Test count: 313 → 387 (+74).
Scope completion estimate: 65-70% → 72-78%.
Major remaining items: M6 Mac Electron (still 0%), M7 file panel (depends
on M6), and the M3c-rest/M8/M5.2 leftovers itemized in the body.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Lands the system-reminder injector from the morning report's M8 polish list. The agent now sees a
<system-reminder>block prepended to every user message with the things long contexts let it forget: today's date, the cwd, pending todos, files that were modified externally between turns, and whether the project has an AGENTS.md.5 of the 7 planned reminder types ship;
plan-mode-activeandno-test-yetare stubs in theReminderTypeunion for future work.Builders
Today's date is YYYY-MM-DD (UTC).— always fires.Current working directory: <path>— always fires./initwhen no AGENTS.md/DEEPCODE.md/CLAUDE.md in cwd.<sessionDir>/todos.json; lists in_progress + pending (usesactiveFormfor in_progress).Map<path, mtimeMs>, flags drift > 1s and deletions; caps at 5 + "more" suffix.Wiring
runAgent({ systemReminders: false | { enabled: [...] } })controls the injection. Default ON. Reminder builder errors are caught and don't poison the batch.Test plan
pnpm -r test— 340 + 47 = 387 passing (was 317 + 47 = 364; +23 new: 21 reminder unit + 2 agent integration)pnpm -F @deepcode/core build— cleansystemReminders: falseskips entirely.🤖 Generated with Claude Code